VERSION 5.00
Begin VB.Form frmStatus 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Status Flags"
   ClientHeight    =   2175
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   3375
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2175
   ScaleWidth      =   3375
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdUpdate 
      Caption         =   "&Update"
      Height          =   375
      Left            =   2400
      TabIndex        =   6
      Top             =   1680
      Width           =   855
   End
   Begin VB.TextBox Text2 
      Height          =   285
      Left            =   1080
      TabIndex        =   3
      Text            =   "Text2"
      Top             =   480
      Width           =   2175
   End
   Begin VB.TextBox Text1 
      Height          =   285
      Left            =   1080
      TabIndex        =   2
      Text            =   "Text1"
      Top             =   120
      Width           =   2175
   End
   Begin VB.CheckBox chkASS_RE_ASSESSMENT 
      Caption         =   "RE Assessment"
      Height          =   195
      Left            =   120
      TabIndex        =   7
      Top             =   960
      Width           =   1815
   End
   Begin VB.CheckBox chkASS_REPORTED 
      Caption         =   "Report Generated"
      Height          =   255
      Left            =   120
      TabIndex        =   0
      Top             =   1200
      Width           =   3375
   End
   Begin VB.CheckBox chkASS_DATE_AUTHORISED_SENT 
      Caption         =   "Authorisation Letter Generated"
      Height          =   255
      Left            =   120
      TabIndex        =   1
      Top             =   1440
      Width           =   3495
   End
   Begin VB.CheckBox chkASS_PAID 
      Caption         =   "Paid"
      Height          =   255
      Left            =   120
      TabIndex        =   5
      Top             =   1680
      Width           =   2295
   End
   Begin VB.Label Label1 
      Alignment       =   1  'Right Justify
      Caption         =   "Assessment"
      Height          =   255
      Left            =   120
      TabIndex        =   4
      Top             =   120
      Width           =   855
   End
   Begin VB.Line Line1 
      X1              =   120
      X2              =   3240
      Y1              =   840
      Y2              =   840
   End
End
Attribute VB_Name = "frmStatus"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Option Explicit
'==================================================================================
'Copyright (c) 2003, Andrew Jeremy Gargan (ajg@osite.co.za), Terence Leslie Van Zyl (tvz@osite.co.za)
'
'All rights reserved.
'
'Redistribution and use in source and binary forms, with or without modification,
'are permitted provided that the following conditions are met:
'
'Redistributions of source code must retain the above copyright notice, this list
'of conditions and the following disclaimer.
'
'Redistributions in binary form must reproduce the above copyright notice, this
'list of conditions and the following disclaimer in the documentation and/or other
'materials provided with the distribution.
'
'Neither the name of the <ORGANIZATION> nor the names of its contributors may be
'used to endorse or promote products derived from this software without specific
'prior written permission.
'
'THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
'ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
'WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
'IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
'INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
'BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
'DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
'LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
'OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
'OF THE POSSIBILITY OF SUCH DAMAGE.
'===================================================================================


Private Sub cmdUpdate_Click()
    Dim lvarQuery As String
    lvarQuery = "UPDATE ASSESSMENT SET" & _
                " ASS_DATE_AUTHORISED_SENT=" & chkASS_DATE_AUTHORISED_SENT.Value & _
                " ,ASS_PAID=" & chkASS_PAID.Value & _
                " ,ASS_REPORTED=" & chkASS_REPORTED.Value & _
                " ,ASS_RE_ASSESSMENT=" & chkASS_RE_ASSESSMENT.Value & _
                " WHERE ASS_KEY=" & frmMain.mvarASS_KEY
    
    gvarDatabase.Execute lvarQuery
    Call Unload(Me)
End Sub

Private Sub Form_Load()
    Dim lvarRS As DAO.Recordset
    Dim lvarQuery As String
    
    Text2 = frmMain.mvarASS_KEY
    If Text2 Then
        lvarQuery = "SELECT ASS_INVOICE_NO, ASS_RE_ASSESSMENT,ASS_DATE_AUTHORISED_SENT,ASS_PAID,ASS_REPORTED    FROM ASSESSMENT WHERE ASS_KEY = " & Text2
        Set lvarRS = gvarDatabase.OpenRecordset(lvarQuery, dbOpenForwardOnly)
        Text1 = lvarRS("ASS_INVOICE_NO")
        chkASS_DATE_AUTHORISED_SENT = IIf(IsNull(lvarRS("ASS_DATE_AUTHORISED_SENT")), 0, IIf(lvarRS("ASS_DATE_AUTHORISED_SENT"), 1, 0))
        chkASS_PAID = IIf(IsNull(lvarRS("ASS_PAID")), 0, IIf(lvarRS("ASS_PAID"), 1, 0))
        chkASS_RE_ASSESSMENT = IIf(IsNull(lvarRS("ASS_RE_ASSESSMENT")), 0, IIf(lvarRS("ASS_RE_ASSESSMENT"), 1, 0))
        chkASS_REPORTED = IIf(IsNull(lvarRS("ASS_REPORTED")), 0, IIf(lvarRS("ASS_REPORTED"), 1, 0))
    Else
        Call Unload(Me)
    End If
End Sub
